<!DOCTYPE html>
<html lang="en">
<head>
    <title>销售0级报表</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
          name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link href="/dist/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet"/>
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=4a6c1b54">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .moduleName {
            float: left;
            height: 27px;
            line-height: 27px;
            font-size: 22px;
            text-align: left;
        }

        .tryStyle {
            width: 30px;
            height: 14px;
            line-height: 14px;
            font-size: 12px;
            /* top: 0; */
            right: 0;
            position: absolute;
            border-radius: 5px;
            margin-top: 1px;
            background: red;
            color: #fff;
            margin-right: -2px;
            transform: scale(0.8);
        }

        .nav-tabs-custom {
            padding: 10px;
            margin-bottom: 0;
            box-shadow: none;
            position: relative;
            overflow: hidden;
        }

        .infoReport {
            display: flex;
            justify-content: flex-start;
            text-align: left;
            margin-left: 10px;
        }

        .infoReport div {
            margin: 0 10px;
        }

        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .lineOneNoMore {
            text-align: left;
        }

        .lineOneNoMore span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .mScrollBox {
            float: left;
            position: relative;
        }

        .imgStyle {
            width: 300px;
            height: 400px;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .templateStyle {
            border: 1px solid #ddd;
            margin-bottom: 10px;
            padding-bottom: 10px;
        }

        .table > thead > tr > th {
            padding: 0;
        }

        .table > tbody > tr > td {
            position: relative;
        }
        table{
            margin-bottom: 0 !important;
        }
        table tr td:nth-child(2n){
            background: #f9f9f9;
        }
        .content {
            padding: 8px 8px 0 8px;
        }
    </style>
</head>
<body>
<section class="content iframeH" id="app" v-cloak="">
    <iframe id="ifExprot" style="width:0px;height:0px;display: none;" frameborder="0"></iframe>
    <div class="div-td-content-more"><i></i></div>
        <div class="nav-tabs-custom oaReportNav"><div class="moduleName" >新机</div> <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul></div>
        <div style="padding: 0px 10px; background: rgb(255, 255, 255);">
            <table  class="table  table-bordered text-center " style="width: 820px;">
                <thead>
                <tr>
                    <th  style="width: 100px;" class="tableTitle">公司</th>
                    <th  style="width: 60px;" class="tableTitle">全年合计</th>
                    <th style="width: 50px;" class="tableTitle">11月</th>
                    <th style="width: 50px;" class="tableTitle">12月</th>
                    <th style="width: 50px;" class="tableTitle">1月</th>
                    <th style="width: 50px;" class="tableTitle">2月</th>
                    <th style="width: 50px;" class="tableTitle">3月</th>
                    <th style="width: 50px;" class="tableTitle">4月</th>
                    <th style="width: 50px;" class="tableTitle">5月</th>
                    <th style="width: 50px;" class="tableTitle">6月</th>
                    <th style="width: 50px;" class="tableTitle">7月</th>
                    <th style="width: 50px;" class="tableTitle">8月</th>
                    <th style="width: 50px;" class="tableTitle">9月</th>
                    <th style="width: 50px;" class="tableTitle">10月</th>
                    <th style="width: 50px;" class="tableTitle">11月</th>
                    <th style="width: 50px;" class="tableTitle">12月</th>
                    <th style="width: 60px;" class="tableTitle">今日交车</th>
                </tr>

                </thead>
                <tbody id="tbList">
                <tr v-for="(item,i) in list">
                    <td>{{item.companyName}}</td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'company')">{{item.newTotal==0?'':item.newTotal}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',11)">{{item.new11==0?'':item.new11}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',12)">{{item.new12==0?'':item.new12}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',1)">{{item.new1==0?'':item.new1}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',2)">{{item.new2==0?'':item.new2}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',3)">{{item.new3==0?'':item.new3}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',4)">{{item.new4==0?'':item.new4}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',5)">{{item.new5==0?'':item.new5}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',6)">{{item.new6==0?'':item.new6}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',7)">{{item.new7==0?'':item.new7}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',8)">{{item.new8==0?'':item.new8}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',9)">{{item.new9==0?'':item.new9}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',10)">{{item.new10==0?'':item.new10}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',13)">{{item.new13==0?'':item.new13}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',14)">{{item.new14==0?'':item.new14}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'today',0)">{{item.newDeliveryNum==0?'':item.newDeliveryNum}}</span></td>
                </tr>
                <tr>
                    <td>合计</td>
                    <td>{{all.newTotal==0?'':all.newTotal}}</td>
                    <td>{{all.new11==0?'':all.new11}}</td>
                    <td>{{all.new12==0?'':all.new12}}</td>
                    <td>{{all.new1==0?'':all.new1}}</td>
                    <td>{{all.new2==0?'':all.new2}}</td>
                    <td>{{all.new3==0?'':all.new3}}</td>
                    <td>{{all.new4==0?'':all.new4}}</td>
                    <td>{{all.new5==0?'':all.new5}}</td>
                    <td>{{all.new6==0?'':all.new6}}</td>
                    <td>{{all.new7==0?'':all.new7}}</td>
                    <td>{{all.new8==0?'':all.new8}}</td>
                    <td>{{all.new9==0?'':all.new9}}</td>
                    <td>{{all.new10==0?'':all.new10}}</td>
                    <td>{{all.new13==0?'':all.new13}}</td>
                    <td>{{all.new14==0?'':all.new14}}</td>
                    <td>{{all.newDeliveryNum==0?'':all.newDeliveryNum}}</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="nav-tabs-custom oaReportNav"><div class="moduleName" >旧机/旧房/旧机动车</div> <ul class="nav nav-tabs pull-right" style="margin-bottom: 10px;"></ul></div>
        <div style="padding: 0px 10px; background: rgb(255, 255, 255);">
            <table  class="table  table-bordered text-center " style="width: 820px;">
                <thead>
                <tr>
                    <th  style="width: 100px;" class="tableTitle">公司</th>
                    <th  style="width: 60px;" class="tableTitle">全年合计</th>
                    <th style="width: 50px;" class="tableTitle">11月</th>
                    <th style="width: 50px;" class="tableTitle">12月</th>
                    <th style="width: 50px;" class="tableTitle">1月</th>
                    <th style="width: 50px;" class="tableTitle">2月</th>
                    <th style="width: 50px;" class="tableTitle">3月</th>
                    <th style="width: 50px;" class="tableTitle">4月</th>
                    <th style="width: 50px;" class="tableTitle">5月</th>
                    <th style="width: 50px;" class="tableTitle">6月</th>
                    <th style="width: 50px;" class="tableTitle">7月</th>
                    <th style="width: 50px;" class="tableTitle">8月</th>
                    <th style="width: 50px;" class="tableTitle">9月</th>
                    <th style="width: 50px;" class="tableTitle">10月</th>
                    <th style="width: 50px;" class="tableTitle">11月</th>
                    <th style="width: 50px;" class="tableTitle">12月</th>
                    <th style="width: 60px;" class="tableTitle">今日交车</th>
                </tr>
                </thead>
                <tbody id="">
                <tr v-for="item in list">
                    <td>{{item.companyName}}</td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'company')">{{item.oldTotal==0?'':item.oldTotal}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',11)">{{item.old11==0?'':item.old11}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',12)">{{item.old12==0?'':item.old12}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',1)">{{item.old1==0?'':item.old1}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',2)">{{item.old2==0?'':item.old2}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',3)">{{item.old3==0?'':item.old3}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',4)">{{item.old4==0?'':item.old4}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',5)">{{item.old5==0?'':item.old5}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',6)">{{item.old6==0?'':item.old6}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',7)">{{item.old7==0?'':item.old7}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',8)">{{item.old8==0?'':item.old8}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',9)">{{item.old9==0?'':item.old9}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',10)">{{item.old10==0?'':item.old10}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',13)">{{item.old13==0?'':item.old13}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'month',14)">{{item.old14==0?'':item.old14}}</span></td>
                    <td><span style="color:#2a8cec;cursor: pointer;" @click="openSalesDetailCom(item,'today',0)">{{item.oldDeliveryNum==0?'':item.oldDeliveryNum}}</span></td>
                </tr>
                <tr>
                    <td>合计</td>
                    <td>{{all.oldTotal==0?'':all.oldTotal}}</td>
                    <td>{{all.old11==0?'':all.old11}}</td>
                    <td>{{all.old12==0?'':all.old12}}</td>
                    <td>{{all.old1==0?'':all.old1}}</td>
                    <td>{{all.old2==0?'':all.old2}}</td>
                    <td>{{all.old3==0?'':all.old3}}</td>
                    <td>{{all.old4==0?'':all.old4}}</td>
                    <td>{{all.old5==0?'':all.old5}}</td>
                    <td>{{all.old6==0?'':all.old6}}</td>
                    <td>{{all.old7==0?'':all.old7}}</td>
                    <td>{{all.old8==0?'':all.old8}}</td>
                    <td>{{all.old9==0?'':all.old9}}</td>
                    <td>{{all.old10==0?'':all.old10}}</td>
                    <td>{{all.old13==0?'':all.old13}}</td>
                    <td>{{all.old14==0?'':all.old14}}</td>
                    <td>{{all.oldDeliveryNum==0?'':all.oldDeliveryNum}}</td>
                </tr>
                </tbody>
            </table>
        </div>
</section>
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=8e743a31"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<!--ztree组件所需js-->
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.all-3.5.min.js"></script>
<script type="text/javascript" src="/dist/plugins/ztree/js/jquery.ztree.exhide-3.5.js"></script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            list:[],
            dateTime:'',
            day:new Date().Format("yyyy-MM-dd"),//今天
            all:{}
        },
        methods: {
            openSalesDetailCom: function (item,type,i) {
                var nowYearMonth = new Date().Format("yyyy");
                console.log(nowYearMonth-1 +'-'+12)
                var dateTime = '';
                if(i == 11){
                    dateTime = nowYearMonth-1 +'-'+'11';
                    console.log(dateTime)
                }
                if(i == 12){
                    dateTime = nowYearMonth-1 +'-'+'12';
                    console.log(dateTime)
                }
                if(i == 0){
                    dateTime = new Date().Format("yyyy-MM-dd");
                    console.log(dateTime)
                }
                if(i == 1){
                    dateTime = nowYearMonth +'-'+'01';
                    console.log(dateTime)
                }
                if(i == 2){
                    dateTime = nowYearMonth +'-'+'02';
                    console.log(dateTime)
                }
                if(i == 3){
                    dateTime = nowYearMonth +'-'+'03';
                    console.log(dateTime)
                }
                if(i == 4){
                    dateTime = nowYearMonth +'-'+'04';
                    console.log(dateTime)
                }
                if(i == 5){
                    dateTime = nowYearMonth +'-'+'05';
                    console.log(dateTime)
                }
                if(i == 6){
                    dateTime = nowYearMonth +'-'+'06';
                    console.log(dateTime)
                }
                if(i == 7){
                    dateTime = nowYearMonth +'-'+'07';
                    console.log(dateTime)
                }
                if(i == 8){
                    dateTime = nowYearMonth +'-'+'08';
                    console.log(dateTime)
                }
                if(i == 9){
                    dateTime = nowYearMonth +'-'+'09';
                    console.log(dateTime)
                }
                if(i == 10){
                    dateTime = nowYearMonth +'-'+'10';
                    console.log(dateTime)
                }
                if(i == 13){
                    dateTime = nowYearMonth +'-'+'11';
                    console.log(dateTime)
                }
                if(i == 14){
                    dateTime = nowYearMonth +'-'+'12';
                    console.log(dateTime)
                }

                var that = this;
                var condition = '&dateTime=' + dateTime ;
                top.closeTabByPageId("openSalesDetail");
                if(type == 'company'){
                    top.addTabs({
                        id: "openSalesDetail",
                        title: item.companyName + "销售列表",
                        close: true,
                        url: '/apply/salesAccount/sales0List.html?companyId=' + item.companyId ,
                    });
                }
                if(type == 'month'){
                    top.addTabs({
                        id: "openSalesDetail",
                        title: item.companyName + "销售列表",
                        close: true,
                        url: '/apply/salesAccount/sales0List.html?companyId=' + item.companyId + condition ,
                    });
                }
                if(type == 'today'){
                    top.addTabs({
                        id: "openSalesDetail",
                        title: item.companyName + "销售列表",
                        close: true,
                        url: '/apply/salesAccount/sales0List.html?companyId=' + item.companyId + condition ,
                    });
                }
            },
            //获取合计
            getCount: function (arr, key) {
                var number = 0;
                for (var i = arr.length - 1; i >= 0; i--) {
                    number += (arr[i][key] && arr[i][key] != '-' ? arr[i][key] : 0)

                }
                return number;
            },
            getTotalNew:function (item) {
                return item.new11+item.new12+item.new1+item.new2+item.new3+item.new4+item.new5+item.new6+item.new7+item.new8+item.new9+item.new10;
            },
            getTotalOld:function (item) {
                console.log(item)
                return item.old11+item.old12+item.old1+item.old2+item.old3+item.old4+item.old5+item.old6+item.old7+item.old8+item.old9+item.old10;
            }
        },

        mounted: function () {
            var that = this;
            $.wyui.postMethod("/contractMain/getSales0List.json",
                {dateTime:new Date().Format("yyyy-MM-dd")},
                function (data){
                    that.list= data.records;
                    console.log(that.list)
                    that.all.newTotal = that.getCount(that.list, "newTotal");
                    that.all.new11 = that.getCount(that.list, "new11");
                    that.all.new12 = that.getCount(that.list, "new12");
                    that.all.new1 = that.getCount(that.list, "new1");
                    that.all.new2 = that.getCount(that.list, "new2");
                    that.all.new3 = that.getCount(that.list, "new3");
                    that.all.new4 = that.getCount(that.list, "new4");
                    that.all.new5 = that.getCount(that.list, "new5");
                    that.all.new6 = that.getCount(that.list, "new6");
                    that.all.new7 = that.getCount(that.list, "new7");
                    that.all.new8 = that.getCount(that.list, "new8");
                    that.all.new9 = that.getCount(that.list, "new9");
                    that.all.new10 = that.getCount(that.list, "new10");
                    that.all.new13 = that.getCount(that.list, "new13");
                    that.all.new14 = that.getCount(that.list, "new14");
                    that.all.newDeliveryNum = that.getCount(that.list, "newDeliveryNum");
                    that.all.oldTotal = that.getCount(that.list, "oldTotal");
                    that.all.old11 = that.getCount(that.list, "old11");
                    that.all.old12 = that.getCount(that.list, "old12");
                    that.all.old1 = that.getCount(that.list, "old1");
                    that.all.old2 = that.getCount(that.list, "old2");
                    that.all.old3 = that.getCount(that.list, "old3");
                    that.all.old4 = that.getCount(that.list, "old4");
                    that.all.old5 = that.getCount(that.list, "old5");
                    that.all.old6 = that.getCount(that.list, "old6");
                    that.all.old7 = that.getCount(that.list, "old7");
                    that.all.old8 = that.getCount(that.list, "old8");
                    that.all.old9 = that.getCount(that.list, "old9");
                    that.all.old10 = that.getCount(that.list, "old10");
                    that.all.old13 = that.getCount(that.list, "old13");
                    that.all.old14 = that.getCount(that.list, "old14");
                    that.all.oldDeliveryNum = that.getCount(that.list, "oldDeliveryNum");
                });
        }
    });

</script>
</body>